SOURCE_DIR := ./source_dir
SOURCE_FILE = $(wildcard *.c)
SOURCE_FILE += $(wildcard $(SOURCE_DIR)/*.c)
SOURCE_PWD := $(wildcard *.c)

target1:
	@echo $(SOURCE_DIR)

target2:
	@echo $(SOURCE_FILE)

target3:
	@echo $(foreach n, $(SOURCE_FILE), $(n))

target4:
	@echo $(notdir $(foreach n, $(SOURCE_FILE), $(n)))


target5:
	@echo $(patsubst %.c, %.o, $(SOURCE_PWD))


a = dir/1 dir/2 dir dir/4
target6:
	@echo $(patsubst dir/%,%,$a)
	@echo $(patsubst dir,DIR,$a)

target7:
    ifeq ($(SOURCE_DIR), $(wildcard $(SOURCE_DIR)))
		#do something here
		@echo $(SOURCE_DIR)
    else
		@echo $(SOURCE_PWD)
    endif


exist = $(shell if [ -f $(SOURCE_DIR) ]; then echo "exist"; else echo "notexist"; fi;)
# target8 can not get my hope output
target8:
    ifeq (exist, "exist")
		#do something here
    else
		@echo $(SOURCE_PWD)
    endif

target9:
	$(shell mkdir -p $(SOURCE_PWD)/updater/src/.profile)
